package com.eastfair.pay.enums;
import io.swagger.annotations.ApiModel;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 开票状态
 * </p>
 *
 * @author clm
 * @date 2022-06-21
 */
@Getter
@NoArgsConstructor
@ApiModel(value = "InvoiceStateEnum", description = "")
public enum InvoiceTypeEnum {

    INVOICE_DZPP("1", "电子普票"),
    INVOICE_ZZPP("2", "纸质普票"),
    INVOICE_DZZP("3", "电子专票"),
    INVOICE_ZZZP("4", "纸质专票"),
    ;

    private String code;

    private String name;

    InvoiceTypeEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }
    public static String getNameByCode(String code) {
        for (InvoiceTypeEnum type : InvoiceTypeEnum.values()) {
            if (code.equals(type.getCode())) {
                return type.name;
            }
        }
        return null;
    }
}
